#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
int main()
{

    string str,s;
    int count[4] = { 0 };
    int length = 0;
    cin >> str;
    for (size_t i = 0;i < str.size();i++)
    {
        if (str[i] == 'G' || str[i] == 'g')
        {
            count[0]++;
            if (count[0] > length)
            {
                length = count[0];
            }
        }
        else if (str[i] == 'P' || str[i] == 'p')
        {
            count[1]++;
            if (count[1] > length)
            {
                length = count[1];
            }
        }
        else if (str[i] == 'L' || str[i] == 'l')
        {
            count[2]++;
            if (count[2] > length)
            {
                length = count[2];
            }
        }
        else if (str[i] == 'T' || str[i] == 't')
        {
            count[3]++;
            if (count[3] > length)
            {
                length = count[3];
            }
        }
    }
    for (size_t i = 0;i < length;i++)
    {
        if (count[0] != 0)
        {
            cout << 'G';
            count[0]--;
        }
        if (count[1] != 0)
        {
            cout << 'P';
            count[1]--;
        }
        if (count[2] != 0)
        {
            cout << 'L';
            count[2]--;
        }
        if (count[3] != 0)
        {
            cout << 'T';
            count[3]--;
        }
    }
    cout << endl;
    return 0;
}
